//
//  BaseModel.m
//  Feel_at_home
//
//  Created by dlios on 15/9/23.
//  Copyright © 2015年 Feel_at_home. All rights reserved.
//

#import "BaseModel.h"

@implementation BaseModel

-(instancetype)initWithDic:(NSDictionary *)dic
{
    self=[super init];
    if (self) {
        //KVC的赋值方法
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    //    id接口id和需要调用id相同时,做一下区分.用kVC必须调用这种方法,否则会crash.
    if ([key isEqualToString:@"id"]) {
        self.bId=value;
    }
    if ([key isEqualToString:@"description"]) {
        self.bDescription=value;
    }
    
}

@end
